package com.picture;

import android.app.Activity;
import android.graphics.Bitmap;
import android.graphics.Bitmap.Config;
import android.graphics.BitmapFactory;
import android.graphics.Canvas;
import android.os.Bundle;
import android.widget.ImageView;

public class Picture_overlayActivity extends Activity {
	/** Called when the activity is first created. */
	ImageView image;

	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.main);
		Bitmap bmp = BitmapFactory.decodeResource(getResources(), R.drawable.lvoe);
		Bitmap phto = BitmapFactory.decodeResource(getResources(), R.drawable.test);
		Bitmap newBitmap = montage(bmp,phto,100,100);
		image = (ImageView) findViewById(R.id.image);
		image.setImageBitmap(newBitmap);
	}
	
	/*
	 * 获取将两张组合在一起的新图片
	 */
	public Bitmap montage(Bitmap xiangkuang,Bitmap phto,int phtoX,int phtoY){
		Bitmap newBitmap = Bitmap.createBitmap(xiangkuang.getWidth(), xiangkuang.getHeight(), Config.ARGB_8888);  
		Canvas canvas = new Canvas(newBitmap);
		canvas.drawBitmap(phto, phtoX, phtoY, null);
		canvas.drawBitmap(xiangkuang, 0, 0, null);
		return newBitmap;
	}
}